# Copyright 2004-present Facebook. All Rights Reserved.

SOURCE_FILES = [
  'common/cmemory.c',
  'common/cstring.c',
  'common/cwchar.c',
  'common/locmap.c',
  'common/loadednormalizer2impl.cpp',
  'common/punycode.cpp',
  'common/putil.cpp',
  'common/sharedobject.cpp',
  'common/simplepatternformatter.cpp',
  'common/uarrsort.c',
  'common/ubidi.c',
  'common/ubidiln.c',
  'common/ubidi_props.c',
  'common/ubidiwrt.c',
  'common/ucase.cpp',
  'common/ucasemap.cpp',
  'common/ucat.c',
  'common/uchar.c',
  'common/ucln_cmn.cpp',
  'common/ucmndata.c',
  'common/ucnv2022.cpp',
  'common/ucnv_bld.cpp',
  'common/ucnvbocu.cpp',
  'common/ucnv.c',
  'common/ucnv_cb.c',
  'common/ucnv_cnv.c',
  'common/ucnvdisp.c',
  'common/ucnv_err.c',
  'common/ucnv_ext.cpp',
  'common/ucnvhz.c',
  'common/ucnv_io.cpp',
  'common/ucnvisci.c',
  'common/ucnvlat1.c',
  'common/ucnv_lmb.c',
  'common/ucnvmbcs.cpp',
  'common/ucnvscsu.c',
  'common/ucnv_set.c',
  'common/ucnv_u16.c',
  'common/ucnv_u32.c',
  'common/ucnv_u7.c',
  'common/ucnv_u8.c',
  'common/udatamem.c',
  'common/udataswp.c',
  'common/uenum.c',
  'common/uhash.c',
  'common/uinit.cpp',
  'common/uinvchar.c',
  'common/uloc.cpp',
  'common/umapfile.c',
  'common/umath.c',
  'common/umutex.cpp',
  'common/unames.cpp',
  'common/uresbund.cpp',
  'common/ures_cnv.c',
  'common/uresdata.c',
  'common/usc_impl.c',
  'common/uscript.c',
  'common/uscript_props.cpp',
  'common/ushape.cpp',
  'common/ustrcase.cpp',
  'common/ustr_cnv.cpp',
  'common/ustrfmt.c',
  'common/ustring.cpp',
  'common/ustrtrns.cpp',
  'common/ustr_wcs.cpp',
  'common/utf_impl.c',
  'common/utrace.c',
  'common/utrie.cpp',
  'common/utypes.c',
  'common/wintz.c',
  'common/utrie2_builder.cpp',
  'common/icuplug.cpp',
  'common/propsvec.c',
  'common/ulist.c',
  'common/ulistformatter.cpp',
  'common/uloc_keytype.cpp',
  'common/uloc_tag.c',
  'common/ucnv_ct.c',
  'common/bmpset.cpp',
  'common/unisetspan.cpp',
  'common/brkeng.cpp',
  'common/brkiter.cpp',
  'common/caniter.cpp',
  'common/chariter.cpp',
  'common/dictbe.cpp',
  'common/locbased.cpp',
  'common/locid.cpp',
  'common/locutil.cpp',
  'common/normlzr.cpp',
  'common/parsepos.cpp',
  'common/propname.cpp',
  'common/rbbi.cpp',
  'common/rbbidata.cpp',
  'common/rbbinode.cpp',
  'common/rbbirb.cpp',
  'common/rbbiscan.cpp',
  'common/rbbisetb.cpp',
  'common/rbbistbl.cpp',
  'common/rbbitblb.cpp',
  'common/resbund_cnv.cpp',
  'common/resbund.cpp',
  'common/ruleiter.cpp',
  'common/schriter.cpp',
  'common/serv.cpp',
  'common/servlk.cpp',
  'common/servlkf.cpp',
  'common/servls.cpp',
  'common/servnotf.cpp',
  'common/servrbf.cpp',
  'common/servslkf.cpp',
  'common/ubrk.cpp',
  'common/uchriter.cpp',
  'common/uhash_us.cpp',
  'common/uidna.cpp',
  'common/uiter.cpp',
  'common/unifiedcache.cpp',
  'common/unifilt.cpp',
  'common/unifunct.cpp',
  'common/uniset.cpp',
  'common/uniset_props.cpp',
  'common/unistr_case.cpp',
  'common/unistr_cnv.cpp',
  'common/unistr.cpp',
  'common/unistr_props.cpp',
  'common/unormcmp.cpp',
  'common/unorm.cpp',
  'common/uobject.cpp',
  'common/uset.cpp',
  'common/usetiter.cpp',
  'common/uset_props.cpp',
  'common/usprep.cpp',
  'common/ustack.cpp',
  'common/ustrenum.cpp',
  'common/utext.cpp',
  'common/util.cpp',
  'common/util_props.cpp',
  'common/uvector.cpp',
  'common/uvectr32.cpp',
  'common/errorcode.cpp',
  'common/bytestream.cpp',
  'common/stringpiece.cpp',
  'common/dtintrv.cpp',
  'common/ucnvsel.cpp',
  'common/uvectr64.cpp',
  'common/locavailable.cpp',
  'common/locdispnames.cpp',
  'common/loclikely.cpp',
  'common/locresdata.cpp',
  'common/normalizer2impl.cpp',
  'common/normalizer2.cpp',
  'common/filterednormalizer2.cpp',
  'common/ucol_swp.cpp',
  'common/uprops.cpp',
  'common/utrie2.cpp',
  'common/charstr.cpp',
  'common/uts46.cpp',
  'common/udata.cpp',
  'common/appendable.cpp',
  'common/bytestrie.cpp',
  'common/bytestriebuilder.cpp',
  'common/bytestrieiterator.cpp',
  'common/messagepattern.cpp',
  'common/patternprops.cpp',
  'common/stringtriebuilder.cpp',
  'common/ucharstrie.cpp',
  'common/ucharstriebuilder.cpp',
  'common/ucharstrieiterator.cpp',
  'common/dictionarydata.cpp',
  'common/ustrcase_locale.cpp',
  'common/unistr_titlecase_brkiter.cpp',
  'common/uniset_closure.cpp',
  'common/ucasemap_titlecase_brkiter.cpp',
  'common/ustr_titlecase_brkiter.cpp',
  'common/unistr_case_locale.cpp',
  'common/listformatter.cpp',
  'stubdata/stubdata.c',
]

cxx_library(
  name = 'common',
  preprocessor_flags = [
    '-D_REENTRANT',
    '-DU_COMMON_IMPLEMENTATION',
    '-DPIC',
  ],
  compiler_flags = [
    '-O3',
    '-fvisibility=hidden',
    '-Wno-unused-parameter',
    '-Wno-missing-field-initializers',
    '-Wno-sign-compare',
    '-Wno-deprecated-declarations',
    '-Wno-unused-function',
    '-fPIC',
    '-Os',
  ],
  header_namespace='',
  linker_flags = [
  ],
  headers = subdir_glob([
    ('common', '*.h'),
    ('common', 'unicode/*.h'),
  ]),
  exported_headers = subdir_glob([
    ('common', 'unicode/*.h'),
  ]),
  srcs = map(lambda x: (x, ['-frtti']) if x.endswith('.cpp') else x, SOURCE_FILES),
  visibility = [
    'PUBLIC',
  ],
)

cxx_library(
  name = 'i18n',
  preprocessor_flags = [
    '-D_REENTRANT',
    '-DPIC',
    '-DU_I18N_IMPLEMENTATION',
  ],
  compiler_flags = [
    '-fvisibility=hidden',
    '-fPIC',
    '-Os',
    '-Wno-deprecated-declarations',
  ],
  header_namespace='',
  linker_flags = [
  ],
  headers = subdir_glob([
    ('common', '*.h'),
    ('common', 'unicode/*.h'),
    ('i18n', '*.h'),
    ('i18n', 'unicode/*.h'),
  ]),
  exported_headers = subdir_glob([
    ('i18n', 'unicode/*.h'),
  ]),
  visibility = [
    'PUBLIC',
  ],
)
